package com.su.fileupload.service.impl;

import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.su.fileupload.entity.SysChunk;
import com.su.fileupload.entity.SysFileList;
import com.su.fileupload.mapper.SysFileListMapper;
import com.su.fileupload.service.ISysChunkService;
import com.su.fileupload.service.ISysFileListService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.su.fileupload.vo.request.FileChunkRequest;
import com.su.fileupload.vo.response.FileChunkCheckResponse;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;

import javax.annotation.Resource;
import java.util.List;
import java.util.function.ToIntFunction;
import java.util.stream.Collectors;

/**
 * <p>
 * 文件列表 服务实现类
 * </p>
 *
 * @author susj
 * @since 2023-08-13
 */
@Service
public class SysFileListServiceImpl extends ServiceImpl<SysFileListMapper, SysFileList> implements ISysFileListService {


    @Override
    public SysFileList getByMd5(String md5) {
        LambdaQueryWrapper<SysFileList> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(SysFileList::getIdentifier, md5);
        return this.getOne(queryWrapper);
    }
}
